package com.yh.modules.data.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yh.modules.data.dao.DataMsgDao;
import com.yh.modules.data.entity.DataMsgEntity;
import com.yh.modules.data.service.DataMsgService;
import lombok.NonNull;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("dataMsgService")
public class DataMsgServiceImpl extends ServiceImpl<DataMsgDao, DataMsgEntity> implements DataMsgService {


	@Override
	public List<DataMsgEntity> getDataMsgListByMachineId(@NonNull Integer machineId) {

		EntityWrapper<DataMsgEntity> wrapper = new EntityWrapper<>();
		wrapper.eq("machine_id", machineId);
		wrapper.orderBy("sort", false);

		return this.selectList(wrapper);
	}
}
